/**
 *
 */
angular.module("MetronicApp").directive('customTab', function () {
    return {
        templateUrl: 'js/directives/customTab/template.html',
        restrict: 'EA',
        scope: {
            tabItemList: '='
        },
        replace: true,
        link: function ($scope, $element, $attrs) {

        },
        controller: ['$scope', '$state','$stateParams', function ($scope, $state, $stateParams) {
            //切换五个页面
            $scope.changePage = function (item) {
                $state.go(item.router);
                angular.forEach($scope.tabItemList, function (tab) {
                    if (item.name == tab.name) {
                        tab.selected = true
                    } else {
                        tab.selected = false
                    }
                })
            }
        }]
    };
})

